(function(clazz,id){
	var grid;
	var classdat = Get("/clazz/name/"+clazz).obj;
	var columns = _("model.fun.getColumns")(classdat.fields); 
	var callback = function(clazz,pid){
		var data = _("model.fun.getData")(clazz);
		Ext.getCmp(pid).store.loadData(data);
	}
	
	
	
	
	columns.push({
		xtype: 'actioncolumn',
		text:"部署",  flex:1,
        items: [{
        	icon: "lib/ext/shared/icons/fam/application_go.png",
            tooltip: "删除",
            handler: function(grid, rowIndex, colIndex) {
            	//_("entity.delete.onepanel")(clazz,id,callback,grid.store.getAt(rowIndex).data);
            	Ext.MessageBox.confirm("部署","是否要部署?"+grid.store.getAt(rowIndex).data.name,function(ide){
            		if(ide=="yes"){
            			Post('/models/'+grid.store.getAt(rowIndex).data.id+'/deployment');
                    	if(callback!=null){
            				//回调
            				eval(callback)(clazz, id);
            			}
            		}
            		
            	});
            
            }
        }] 
	});
	
	
	
	
	
	columns.push({
		xtype: 'actioncolumn',
        text:"修改",  flex:1,
        items: [{
        	icon: "lib/ext/shared/icons/fam/grid.png",
            tooltip: "修改",
            handler: function(grid, rowIndex, colIndex) {
            	//log(grid.store.getAt(rowIndex).data);
            	_("model.add.panel")(clazz,id,callback,grid.store.getAt(rowIndex).data);
            }
        }] 
	});

	columns.push({
		xtype: 'actioncolumn',
		text:"删除",  flex:1,
        items: [{
        	icon: "lib/ext/shared/icons/fam/delete.gif",
            tooltip: "删除",
            handler: function(grid, rowIndex, colIndex) {
            	//_("entity.delete.onepanel")(clazz,id,callback,grid.store.getAt(rowIndex).data);
            	Ext.MessageBox.confirm("删除框","是否要删除?"+grid.store.getAt(rowIndex).data.name,function(ide){
            		if(ide=="yes"){
            			Delete('/models/'+grid.store.getAt(rowIndex).data.id);
                    	if(callback!=null){
            				//回调
            				eval(callback)(clazz, id);
            			}
            		}
            		
            	});
            
            }
        }] 
	});
	
	
	grid = {
		xtype		:	'gridpanel',
        id			:   id,
    	autoScroll	:	true,
        selModel	:	Ext.create('Ext.selection.CheckboxModel'),
        columns 	:	columns ,
        listeners   : {
        	show:function(){
        		//alert("sdf");
        		callback(clazz,id);
        		setCurrentClass(clazz);
        	}
        } 
	};
	grid["tbar"]	=	_("model.fun.getTbar")(clazz,id,callback);
	grid["store"]	=	_("model.fun.getStore")(clazz);
	return grid;
})